package Model;

public class Constraint {
	
	private int sequence;
	private String query;
	private String staticNumber;
	private String staticValue;
	private String tablename;
	private String columnName;

	public Constraint(int seq, String Query, String staticnumber, String staticvalue, String table, String column){
		sequence = seq;
		query = Query;
		staticNumber = staticnumber;
		staticValue = staticvalue;
		tablename = table;
		columnName = column;
		
	}
	
	public String giveConstraint(){
		String constrainReturn = "";
			if(query != null){
				constrainReturn = query;
			}
			else if(staticNumber != null){
				constrainReturn = staticNumber;
			} else if(staticValue != null){
				constrainReturn = staticValue;
			} else if(tablename != null){
				constrainReturn = tablename + "." + columnName;
			} else {
				return null;
			}
		
		return constrainReturn;
	}
	
}
